chcp 65001
@echo off
echo 正在启动CosyVoice API服务...

:: 检查并激活conda环境
call conda info --envs | findstr /C:"cosyvoice" > nul
if %errorlevel% equ 0 (
    echo 找到cosyvoice环境，正在激活...
    call conda activate cosyvoice
) else (
    echo 没有找到cosyvoice环境，请先创建环境
    exit /b 1
)

:: 检查NumPy是否可用
python -c "import numpy" > nul 2>&1
if %errorlevel% neq 0 (
    echo NumPy导入失败！请先运行fix_transformers_numpy.bat脚本修复环境
    exit /b 1
)

:: 启动API服务
echo 启动API服务...
python cosyvoice_api.py

pause 